package com.itqf.client;

import com.itqf.entity.TbItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/12/23
 * @Time: 下午4:37
 */
//伪装调用 eureka-client-provider 服务提供的服务
    //serviceId  服务名 ： spring.application.name
    //fallback  服务降级
    //fallbackFactory+提供者的异常信息
//@FeignClient(serviceId = "eureka-client-provider",fallback = TbItemFeignClientFallBack.class)

@FeignClient(serviceId = "eureka-client-provider",fallbackFactory = TbItemFeiginClientFactory.class)
public interface TbItemFeignClient {

    //接口中的方法和eureka-client-provider 提供的服务（方法对应）

    @RequestMapping("/find/{id}")
    //pathVariable annotation was empty on param 0.
    public TbItem findById(@PathVariable("id") long id);


    @RequestMapping("/findAll")
    public TbItem findAll();



}
